Repository navigation
[SPARK-60669][BUILD][INFRA][DOC] Drop Java 17 Support - #59897
dongjoon-hyun wants to merge 3 commits into
Conversation
|
cc @HyukjinKwon , @cloud-fan , @viirya , @zhengruifeng , @gengliangwang , @peter-toth , @yaooqinn , @LuciferYang , @pan3793 , @uros-b . I also sent a discussion email. |
spark-test
left a comment
There was a problem hiding this comment.
Review summary
The core baseline change is consistent. java.version and java.minimum.version drive maven.compiler.release, the javac --release argument, the enforcer's requireJavaVersion and bytecode ceiling, and SBT's checkJavaVersion, and the scalac -release literal moves with them, so both builds reject JDK 17 with an explicit message. The CI defaults, publish_snapshot.yml's per-branch JDK selection, and the updated documentation pages agree with the new minimum.
The findings with the most direct impact sit outside the build itself:
- The master release image and its Java guard would make the scheduled
release.ymldry run and default 5.0.0 release builds fail at the enforcer. - SparkR's Java check would admit Java 17 and end in a misleading backend-launch failure.
bin/pysparkwould install JDK 17 for users who have no Java.HiveExternalCatalogVersionsSuitewould silently stop testing prior releases on master CI.
The remaining findings are lower-impact workflow, developer-tooling, benchmark, notebook-image, and documentation updates.
Cross-cutting observations
- This PR moves the Java baseline in pom.xml, the CI workflow defaults, and five documentation pages, but the Java 17 minimum is also restated outside those files. It still appears in the master release image and its Java guard, SparkR's DESCRIPTION, the bin/pyspark JDK installer, the binder and local docs images, the Kubernetes integration-test dev script, the master Java 17 workflow, the HiveExternalCatalogVersionsSuite gate, the BenchmarkBase baseline threshold, and the YARN and tuning guides. The previous baseline bump to Java 17 (SPARK-44112) moved the same kinds of consumers through companion changes in the same week, for example SPARK-45284 for SparkR and SPARK-45281 for BenchmarkBase. Handling these here, or as tracked SPARK-60669 subtasks before 5.0.0, would keep the release, launch, test, and documentation surfaces consistent with the new minimum.
Separation: Each consumer restates the minimum independently, and each fix is a self-contained edit with no ordering or runtime coupling. Completing the individual repairs satisfies the shared baseline without a common owner, so the pattern changes no repair's scope, grouping, or severity.
Findings
12 total: 0 P0, 0 P1, 4 P2, 8 P3.
Non-blocking (P2)
-
Master release image and guard still use Java 17 —
pom.xml:124
The master release tooling still provides and accepts Java 17.dev/create-release/spark-rm/Dockerfile(the 'Spark master (5.0.0-SNAPSHOT) release image') installs onlyopenjdk-17-jdk-headless,Dockerfile.baseinstalls no JDK, anddo-release.shsetsJAVA_HOME=/usrinside the container.release.ymlruns a scheduled dry run on apache/spark every two days against master throughdo-release-docker.sh -nwithout-j. After this change every dry run, and any default 5.0.0 preview or RC build, fails atrequireJavaVersion21.release-build.sh(lines 692-695) still lets Java 17 through for Spark 4.0+, and the-jhelp text indo-release-docker.shstill names openjdk17. SPARK-45276 updated the same Dockerfile and script when the baseline last moved. Branch releases use their own copies, so only master's files need to change.Verification:
- Behavior: A release dry run using the master release image without an external JDK reaches and completes the Maven package step on JDK 21.
- Regression: Running the release build for a 5.x version with a JDK 17 JAVA_HOME stops at the release Java-version guard with an explicit Java 21 requirement, instead of failing later in the Maven enforcer.
- Inspection: The master release image definition and the release script usage text no longer name Java 17 as the build JDK.
-
SparkR still declares and enforces Java 17 minimum —
pom.xml:125— see inline. -
bin/pyspark auto-installs JDK 17, which cannot run Spark 5.0 —
pom.xml:124
bin/pyspark(lines 52-73) still provisions Java 17. WhenJAVA_HOMEis unset and nojavais onPATH, it offers to 'install JDK 17', callsjdk.install("17"), exports thatJAVA_HOME, andbin/spark-classthen runsorg.apache.spark.launcher.Mainon it. With this change the launcher is compiled for release 21, so a pip user without Java who answers Y getsUnsupportedClassVersionErrorand no shell, and the decline message still says 'JDK (17 or later)'. The script ships in the PyPI package (pyspark.bin), so this is the supported first-run path. The prompt, the comment, thejdk.installcall, and the message all need to move to 21.Verification:
- Regression: In an environment without JAVA_HOME or java, accepting the pyspark JDK prompt installs JDK 21 and the shell starts a SparkSession.
- Inspection: The pyspark launcher script no longer names JDK 17 in its prompt, install call, comment, or decline message.
-
HiveExternalCatalogVersionsSuite becomes vacuous on master CI —
.github/workflows/build_and_test.yml:28— see inline.
Nit (P3)
-
BenchmarkBase still treats JDK 17 as the unsuffixed baseline —
.github/workflows/benchmark.yml:35— see inline. -
YARN guide still states a Java 17 baseline —
docs/index.md:37— see inline. -
Binder Live Notebook image still ships only JRE 17 —
pom.xml:124
The binder image behind the PySpark docs' Live Notebook links still installsopenjdk-17-jreas its only JVM (binder/Dockerfile:39). On a tagged commit,binder/postBuildinstalls exactly that PySpark version, and the docs build those links from theGIT_HASHrevision. So once a 5.x preview, RC, or final tag exists, the notebooks install PySpark 5.x and fail at SparkSession creation withUnsupportedClassVersionError; untagged master hides this because the<=specifier installs an older release. The image needs a Java 21 runtime. Which Java 21 package thepython:3.11-slimbase can install depends on its Debian release, which was not verified here.Verification:
- Behavior: Building the Live Notebook image from a commit that installs PySpark 5.x and running the DataFrame quickstart creates a SparkSession without a class-version failure.
-
Local containerized docs build still runs on JDK 17 —
pom.xml:124
The local docs utility now mixes a Java 21 host build with a Java 17 container.build-docscompiles Spark on the host, which now requires and emits Java 21 classes, and then runsrun-in-containerinside thedev/spark-test-image/docsimage, which installs onlyopenjdk-17-jdk-headlessand whose script exportsJAVA_HOME=/usr/lib/jvm/java-17-openjdk-arm64. WithSPARK_DOCS_IS_BUILT_ON_HOST=1the SBT steps are skipped, butsql/create-docs.shstill callsbin/spark-submitin the container, which fails on the Java 21 class files and aborts with 'SQL doc generation failed'. CI's docs job is unaffected because it installsinputs.java. The image'subuntu:noblebase provides a JDK 21 package, so the image andJAVA_HOMEcan both move to 21.Verification:
- Behavior: Running the containerized local docs build end to end produces the documentation, including the SQL API docs, without a Java class-version failure.
- Compatibility: The CI documentation job, which installs its own JDK, still builds the docs with the updated image.
-
K8s integration-test dev script overrides java.version to 17 —
pom.xml:124— see inline. -
build_maven.yml now duplicates build_maven_java21.yml —
.github/workflows/build_maven.yml:20— see inline. -
build_java17.yml remains a live Java 17 master build —
pom.xml:124
.github/workflows/build_java17.ymlstill defines a real Java 17 build on master. It is dispatch-only and callsbuild_and_test.ymlwithjava: 17and nobranchinput, so the build defaults to master, which SBT'scheckJavaVersionand Maven'srequireJavaVersionnow reject. A master dispatch can only fail, and future branch cuts inherit master's copy. The file has to stay on master for the branch schedulers'--ref branch-*dispatches and the README badges. The repository already handles that case with no-op placeholders (build_scala213.yml,build_python_3.9.yml,build_python_pypy3.10.yml), and converting this file the same way keeps branch dispatch and badges working.See Shared repair plan 2 in the review body.
-
Tuning guide still says Spark uses JDK 17 by default —
docs/index.md:37
docs/tuning.md:235still says 'Since 4.0.0, Spark uses JDK 17 by default, which also makes the G1GC garbage collector the default.' Spark 5.0 can no longer run on JDK 17, so the 5.0 tuning guide now states the wrong default runtime. The G1GC advice is still valid on JDK 21, so only the version statement needs to change.See Shared repair plan 1 in the review body.
Shared repair plans
Shared repair plan 1
Covered findings:
- YARN guide still states a Java 17 baseline —
docs/index.md:37 - Tuning guide still says Spark uses JDK 17 by default —
docs/index.md:37
Verification:
- Inspection: The YARN and tuning guides state the Java 21 minimum consistently with the supported-runtime statement on the documentation index, and the YARN JDK example no longer uses a Java 17 path.
Shared repair plan 2
Covered findings:
- build_maven.yml now duplicates build_maven_java21.yml —
.github/workflows/build_maven.yml:20 - build_java17.yml remains a live Java 17 master build —
pom.xml:124
Verification:
- Inspection: On master, the Java 17 and Maven JDK 21 workflow files contain only a workflow_dispatch trigger and a no-op job, every workflow display name is unique, and the README master table lists one Maven JDK 21 build.
- Compatibility: The release-branch schedulers can still dispatch both workflows by release ref, and the branch-4.x and branch-4.3 README badges for them still resolve.
Generated by Omnigent on Databricks
| <java.version>17</java.version> | ||
| <java.minimum.version>17.0.11</java.minimum.version> | ||
| <java.version>21</java.version> | ||
| <java.minimum.version>21</java.minimum.version> |
There was a problem hiding this comment.
Non-blocking (P2): R/pkg/DESCRIPTION:13 still declares SystemRequirements: Java (>= 17, < 26), and SparkR's checkJavaVersion() (R/pkg/R/client.R) reads its lower bound from that field before sparkR.session() launches the backend. With the minimum now 21, a SparkR user on Java 17 passes the guard. The spark-submit launcher, compiled for release 21, then fails with UnsupportedClassVersionError, and SparkR ends with the misleading JVM is not ready after 10 seconds instead of its explicit 'Java version ... is required' error. The package metadata also misstates the minimum. The previous baseline bump moved this field in a same-day companion change, SPARK-45284; Java (>= 21, < 26) restores the guard.
Verification:
- Regression: With a Java 17 runtime, starting a SparkR session fails at SparkR's Java version check with the explicit minimum-21 message, not with a backend launch failure.
- Compatibility: With Java 21 and Java 25 runtimes, the SparkR Java version check passes and sessions start as before.
| required: false | ||
| type: string | ||
| default: 17 | ||
| default: 21 |
There was a problem hiding this comment.
Non-blocking (P2): Moving this default to 21 silently disables HiveExternalCatalogVersionsSuite. The suite is @SlowHiveTest and runs in the 'hive - slow tests' entries here and in maven_test.yml with java: ${{ inputs.java }}. PROCESS_TABLES.testingVersions is non-empty only when Utils.isJavaVersionAtMost17 (lines 264-266), and test("backward compatibility") calls runSparkSubmit only when it is non-empty (line 250). No master job can run on Java 17 any more, so every run logs 'Skip tests because old Spark versions don't support Java 21' and passes without testing anything. Master loses its automated check that tables and metadata written by released Spark versions stay readable through HiveExternalCatalog, a main 5.0 upgrade path. Released 4.x lines run on Java 21, so the gate can select the latest release of each line that supports the running JDK instead of returning nothing.
Verification:
- Regression: Running the Hive external catalog backward-compatibility suite on Java 21 exercises at least one prior release line, instead of logging the Java 21 skip and passing vacuously.
- Compatibility: Release lines that cannot run on the current JDK, such as 3.5.x on Java 21, are excluded, so the suite does not fail spuriously.
| default: '17' | ||
| default: '21' | ||
| options: | ||
| - '17' |
There was a problem hiding this comment.
Nit (P3): Without the JDK 17 option, nothing can regenerate the unsuffixed baseline files. BenchmarkBase.scala:55 still suffixes result files only when version > 17, so every run this workflow can launch writes -jdk21 or -jdk25 files. The 126 committed unsuffixed *-results.txt files, 125 of which report a JDK 17 VM (for example KryoBenchmark-results.txt), stay frozen as JDK 17 snapshots that still look like the default baseline, and the scaladocs that say results go to benchmarks/<Name>-results.txt describe files no supported run writes. When the baseline last moved, SPARK-45281 changed this threshold from > 8 to > 17 and companion changes refreshed and pruned the result files; moving it to > 21 follows the same pattern.
Verification:
- Behavior: Regenerating a benchmark on JDK 21 writes the unsuffixed result file, and regenerating it on JDK 25 writes the jdk25-suffixed file.
- Inspection: No committed unsuffixed benchmark result file names a JDK 17 VM in its header, and no orphaned jdk21-suffixed duplicates remain.
| Spark runs on both Windows and UNIX-like systems (e.g. Linux, Mac OS), and it should run on any platform that runs a supported version of Java. This should include JVMs on x86_64 and ARM64. It's easy to run locally on one machine --- all you need is to have `java` installed on your system `PATH`, or the `JAVA_HOME` environment variable pointing to a Java installation. | ||
|
|
||
| Spark runs on Java 17/21/25, Scala 2.13, Python 3.11+, and R 4.0+ (Deprecated). | ||
| Spark runs on Java 21/25, Scala 2.13, Python 3.11+, and R 4.0+ (Deprecated). |
There was a problem hiding this comment.
Nit (P3): docs/running-on-yarn.md still contradicts this line. Line 36 says 'Apache Spark requires at least Java 17 since 4.0.0' and asks for a separate JDK only when Hadoop is older than 3.5.0, and the JDK example at lines 1072-1078 points JAVA_HOME, spark.yarn.appMasterEnv.JAVA_HOME, and spark.executorEnv.JAVA_HOME at /opt/openjdk-17. A user who follows that page on a cluster whose nodes run Java 17 gets an ApplicationMaster and executors that cannot load Spark 5.0's Java 21 classes. The baseline sentence, the Hadoop condition, and the example path need to reflect Java 21.
See Shared repair plan 1 in the review body.
| <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
| <java.version>17</java.version> | ||
| <java.minimum.version>17.0.11</java.minimum.version> | ||
| <java.version>21</java.version> |
There was a problem hiding this comment.
Nit (P3): The Kubernetes integration-test dev script still overrides this property to 17. resource-managers/kubernetes/integration-tests/dev/dev-run-integration-tests.sh:41 defaults JAVA_VERSION="17", and line 145 passes -Djava.version=$JAVA_VERSION to its build/mvn install ... -am build. That replaces java.version=21 in maven.compiler.release, the javac --release argument, requireJavaVersion, and the enforceBytecodeVersion ceiling, while the scalac -release literal further down stays 21. A default developer run therefore compiles Java sources for release 17 and Scala sources for release 21, which matches neither the shipped build nor anything CI runs. Whether the release-17 bytecode ceiling also rejects the release-21 reactor jars was not verified without a Maven build. A default of 21 keeps the script consistent with the POM.
Verification:
- Behavior: With default arguments, the Kubernetes integration-test dev build compiles Java and Scala classes for the same release 21 target as the shipped build.
| # | ||
|
|
||
| name: "Build / Maven (Scala 2.13, JDK 17)" | ||
| name: "Build / Maven (Scala 2.13, JDK 21)" |
There was a problem hiding this comment.
Nit (P3): This name is already used by build_maven_java21.yml, and after the default change the two workflows are the same build. Apart from cron (0 13 vs 0 14, every two days), they differ only in build_maven_java21.yml's explicit java: 21, which is now maven_test.yml's default. So master runs two identical full Maven JDK 21 test jobs under one display name, and the README master table shows both badges. The branch schedulers dispatch both files with --ref branch-*, so neither can simply be deleted. Turning master's build_maven_java21.yml into a no-op placeholder like build_scala213.yml, with a distinct display name and without the duplicate README badge, removes the duplicate run and keeps branch dispatch and badges working.
See Shared repair plan 2 in the review body.
sarutak
left a comment
There was a problem hiding this comment.
The pom.xml, SBT, and CI default changes look correct to me. Here are a few points that are not covered by the existing review.
-
Could you expand the user-facing section of the PR description a little? No module overrides
java.versionormaven.compiler.release, so all published jars now target class file version 65. This means Java 21 is also required on the client side, not only for the cluster runtime: for example, applications using the Spark Connect JVM client (spark-connect-client-jvm) or the Connect JDBC driver, services embeddingspark-launcher, and libraries compiled against the Spark 5.0 artifacts with JDK 17. The pure-Pythonpyspark-clientis not affected. Since this section becomes part of the commit message, mentioning these would help downstream users. -
In addition to
docs/tuning.md:235mentioned in the other review, the same page still links to the Java 17 docs at lines 44, 47, 49, and 246 (https://docs.oracle.com/en/java/javase/17/...). This PR already updates the same kind of links indocs/security.md, so it may be natural to update them here as well. -
Users who run Spark 4.x on Java 17 will see some query results change when they move to Spark 5.0, because of JDK behavior changes that the
.java21golden files already capture. It would be helpful to note them in the migration guide (here or in a follow-up):- Float/Double to string conversion now produces the shortest representation (JDK-4511638), so the last digits can differ, e.g.
4.6116860184273879E18becomes4.611686018427388E18. This also shows up in values derived from the string form, e.g. one result inpostgreSQL/numeric.sqlchanges from107511333880051872.0000000000to107511333880051870.0000000000. - The
'F'pattern indate_format/to_charnow returns the day-of-week-in-month correctly (JDK-8282081), e.g.5instead of3for2019-12-31.
- Float/Double to string conversion now produces the shortest representation (JDK-4511638), so the last digits can differ, e.g.
For the SPARK-60669 follow-up subtasks suggested in the other review, here are a few more items I found:
.java21golden files:SQLQueryTestSuiteandThriftServerQueryTestSuiteuse*.sql.out.java21when running on Java 21+ (7 files, e.g.postgreSQL/float4.sql.out.java21). Since CI now runs only on Java 21 and 25, the corresponding base.sql.outfiles are no longer compared or regenerated, and they will silently become stale. We could promote the.java21contents to the base files and remove the suffix handling.- Java version branches that become dead code, other than the ones already mentioned: the Hive 4.2 Java 21 check in
IsolatedClientLoader,HiveClientVersions,WriteAheadLogSuite, the Java 17.0.14 branch inUtilsSuite, and thejavaVersion >= 18condition inClosureCleaner. This is similar to SPARK-45874 and SPARK-45802 after the previous baseline bump. - Besides
dev/spark-test-image/docs, the 9dev/spark-test-image/python-*images still installopenjdk-17-jdk-headless. CI is not affected becausesetup-javaoverrides it, but the defaultjavain those images is still 17 when they are used locally.
|
Thank you for the review, @sarutak.
|
|
Thank you for the review. This PR now also addresses the following.
I'll handle |
7038316 to
1a66276
Compare
|
Also, rebase to master~ |
|
Since the dev mailing list discussion seems to reach a consensus, could you review this once more, please, @sarutak ? |
|
New Findings
Still Open
|
|
Thank you, @pan3793 . For me, your review bot setting seems to be a little suspicious. For the Open items you mentioned (HiveExternalCatalogVersionsSuite and Benchmark), I already mentioned I will handle them seperately. WDYT? |
|
It's unreasonable to put everything in a single PR. Especially, Benchmark and release scripts should be tested carefully and manually verified. I clearly documented that from the beginning, @pan3793 . |
viirya
left a comment
There was a problem hiding this comment.
The core change looks right to me. A few small things the previous reviews did not cover are inline. Two more are outside the diff:
.github/workflows/build_and_test.yml:955-956still says "the other jobs, on Java 17, skip the tests that load a library", and the class doc ofNativeLibrary.java:46says "Spark compiles for Java 17". Both should say 21 now. The logic still holds, since the FFM API is final only in Java 22.- For the dead-branch follow-up:
Utils.isJavaVersionAtLeast21inRestSubmissionServer(spark.master.rest.virtualThread.enabled) and its check inStandaloneRestSubmitSuiteare now always true.
Master loses the HiveExternalCatalogVersionsSuite backward-compatibility check as soon as this merges, so it would be good to track that as a SPARK-60669 subtask before 5.0.0.
| EXCLUDE_TAGS= | ||
| DEFAULT_EXCLUDE_TAGS="N/A" | ||
| JAVA_VERSION="17" | ||
| JAVA_VERSION="21" |
There was a problem hiding this comment.
resource-managers/kubernetes/integration-tests/README.md:145 still says the default of --java-version is 17.
There was a problem hiding this comment.
Thank you. I updated the default in README.md too.
| packages: write | ||
| name: Run | ||
| uses: ./.github/workflows/build_and_test.yml | ||
| noop: |
There was a problem hiding this comment.
Could this file and build_maven_java21.yml get a header comment like the one in build_scala213.yml? Without it, nothing says that the README badges and the branch4*_scheduler.yml dispatches (--ref branch-4.*) depend on these files staying on master, and they look safe to delete.
There was a problem hiding this comment.
Thank you. I added a placeholder header to both files like build_scala213.yml. It also mentions the branch4*_scheduler.yml dispatches.
| occupies 2/3 of the heap. It should be large enough such that this fraction exceeds `spark.memory.fraction`. | ||
|
|
||
| * Since 4.0.0, Spark uses JDK 17 by default, which also makes the G1GC garbage collector the default. Note that with | ||
| * Since 5.0.0, Spark uses JDK 21 by default, which also makes the G1GC garbage collector the default. Note that with |
There was a problem hiding this comment.
This reads as if G1 became the default in 5.0. G1 has been the JVM default since JDK 9, and 21 is the minimum rather than a default Spark picks. Maybe: "Spark requires JDK 21 or later, where G1GC is the default garbage collector."
There was a problem hiding this comment.
Thank you. I used your wording.
|
Thank you, @viirya , too. |
|
For the record, |
@dongjoon-hyun, yeah, the review comment was generated by an LLM, and I reviewed it and tuned/filtered out several items before posting.
I didn't read the whole PR description and review history manually because it's too long ... and absolutely, handling them separately is fine. |
|
Thank you, @pan3793 . |
cef7f6a to
6d58bc2
Compare
|
Thank you for the review, @viirya.
|
|
Thank you for the new findings, @pan3793.
|
|
Thank you for making this move forward, @pan3793 . |
sarutak
left a comment
There was a problem hiding this comment.
Thank you for the update, @dongjoon-hyun. The PR description and docs/tuning.md now cover my points, and handling the migration guide notes and the other follow-up items in separate PRs sounds good to me. The new changes (the release image and the release-build.sh guard, SparkR, bin/pyspark, the placeholder workflows, and the docs) also look good. LGTM.
|
Thank you, @sarutak ! |
|
For the records, |
viirya
left a comment
There was a problem hiding this comment.
Thanks for the updates, @dongjoon-hyun. LGTM.
|
Thank you, @viirya and @LuciferYang . |
There was a problem hiding this comment.
Thanks for the PR, @dongjoon-hyun!
The build, CI and release changes move the baseline consistently in both Maven and SBT. The Java 17 images left behind (binder, the docs image and the python-* images) are already raised in the spark-test review and sarutak's review. You deferred them to follow-ups in this comment. I have one addition on the YARN guide.
Non-blocking
- 1. YARN shuffle service needs a Java 21 NodeManager: the shuffle service jar is compiled for Java 21 too, and it runs inside the NodeManager JVM. The "configure a different JDK for Spark applications" advice doesn't cover it, so the guide should say the NodeManagers need Java 21. inline
| # Launching Spark on YARN | ||
|
|
||
| Apache Hadoop supports Java 17 since 3.5.0, while Apache Spark requires at least Java 17 since 4.0.0. When running on a YARN cluster whose Hadoop version is older than 3.5.0, a different JDK should be configured for Spark applications. | ||
| Apache Spark requires at least Java 21 since 5.0.0. When running on a YARN cluster with a Java version older than 21, a different JDK should be configured for Spark applications. |
There was a problem hiding this comment.
Finding 1. The YARN external shuffle service is compiled for Java 21 as well, since common/network-yarn doesn't override java.version. It doesn't run in a Spark container. It runs inside the NodeManager JVM, since the "Configuring the External Shuffle Service" section adds spark-<version>-yarn-shuffle.jar to the NodeManager classpath. So setting JAVA_HOME for the AM and the executors doesn't help it, and a NodeManager on Java 17 can't load YarnShuffleService (class file version 65). The guide used to describe running YARN itself on Java 17 with Hadoop 3.5.0, so such clusters are likely.
Could this paragraph say so? For example:
| Apache Spark requires at least Java 21 since 5.0.0. When running on a YARN cluster with a Java version older than 21, a different JDK should be configured for Spark applications. | |
| Apache Spark requires at least Java 21 since 5.0.0. When running on a YARN cluster with a Java version older than 21, a different JDK should be configured for Spark applications. This does not apply to the [external shuffle service](#configuring-the-external-shuffle-service), which runs inside the NodeManager JVM, so the NodeManagers must run on Java 21 or later to use it. |
It would also fit the user-facing list in the PR description, next to spark-launcher.
|
Thank you, @peter-toth . However, that's orthogonal to this PR because Apache Spark 4.0 (built on Java 17) had the same incompatibility on YARN cluster (on Java 8). Let's proceed your suggestion independently because it should be backported to branch-4.x and older branch. In other words, |
|
Here is the PR for your request, @peter-toth . |
… Java version for the Spark Shuffle Service ### What changes were proposed in this pull request? This PR adds a paragraph to the `Configuring the External Shuffle Service` section of `docs/running-on-yarn.md`. It states that: - the Spark Shuffle Service runs inside the `NodeManager` JVM, so all `NodeManager`s must run on a supported version of Java, and - unlike Spark applications, the shuffle service cannot use a different JDK from the `NodeManager`. The paragraph links the supported Java versions in `docs/index.md` instead of naming a Java version, so the same text stays correct when the minimum Java version changes. ### Why are the changes needed? `spark-<version>-yarn-shuffle.jar` is built from `common/network-yarn`, which does not override `java.version`. So its classes target the minimum Java version of Apache Spark, which is Java 17 since Apache Spark 4.0.0. For example, `YarnShuffleService.class` has the class file major version 61 in the 4.0.4, 4.1.3, 4.2.0, and 4.3.0 binary distributions. A `NodeManager` on an older Java cannot load `org.apache.spark.network.yarn.YarnShuffleService`. The guide explains how to use a different JDK for Spark applications when the YARN cluster runs an older Java (`Configuring different JDKs for Spark Applications`). That sets `JAVA_HOME` of the AM and the executors only, and does not help the shuffle service, which the `NodeManager` loads as an auxiliary service. However, the guide has never mentioned the Java requirement of the `NodeManager`s. For example, the [v4.0.0](https://github.com/apache/spark/releases/tag/v4.0.0) (2025-05-19) guide said `Apache Hadoop does not support Java 17 as of 3.4.1`, while its `Configuring the External Shuffle Service` section had no Java requirement. This was raised in the review of #59897 (#59897 (comment)), which makes Java 21 the minimum in Apache Spark 5.0.0. The documentation gap is independent of #59897 because it exists since Apache Spark 4.0.0. ### Does this PR introduce _any_ user-facing change? No. This is a documentation-only change. ### How was this patch tested? Manual review. - Both link targets already exist: the `Downloading` section of `index.md`, which lists the supported Java versions, and the `Configuring different JDKs for Spark Applications` section, which the same page already links at the top. - The class file versions above were read from `yarn/spark-<version>-yarn-shuffle.jar` of the binary distributions. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Opus 5.5 Closes #60052 from dongjoon-hyun/SPARK-60837. Authored-by: Dongjoon Hyun <dongjoon@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
… Java version for the Spark Shuffle Service ### What changes were proposed in this pull request? This PR adds a paragraph to the `Configuring the External Shuffle Service` section of `docs/running-on-yarn.md`. It states that: - the Spark Shuffle Service runs inside the `NodeManager` JVM, so all `NodeManager`s must run on a supported version of Java, and - unlike Spark applications, the shuffle service cannot use a different JDK from the `NodeManager`. The paragraph links the supported Java versions in `docs/index.md` instead of naming a Java version, so the same text stays correct when the minimum Java version changes. ### Why are the changes needed? `spark-<version>-yarn-shuffle.jar` is built from `common/network-yarn`, which does not override `java.version`. So its classes target the minimum Java version of Apache Spark, which is Java 17 since Apache Spark 4.0.0. For example, `YarnShuffleService.class` has the class file major version 61 in the 4.0.4, 4.1.3, 4.2.0, and 4.3.0 binary distributions. A `NodeManager` on an older Java cannot load `org.apache.spark.network.yarn.YarnShuffleService`. The guide explains how to use a different JDK for Spark applications when the YARN cluster runs an older Java (`Configuring different JDKs for Spark Applications`). That sets `JAVA_HOME` of the AM and the executors only, and does not help the shuffle service, which the `NodeManager` loads as an auxiliary service. However, the guide has never mentioned the Java requirement of the `NodeManager`s. For example, the [v4.0.0](https://github.com/apache/spark/releases/tag/v4.0.0) (2025-05-19) guide said `Apache Hadoop does not support Java 17 as of 3.4.1`, while its `Configuring the External Shuffle Service` section had no Java requirement. This was raised in the review of #59897 (#59897 (comment)), which makes Java 21 the minimum in Apache Spark 5.0.0. The documentation gap is independent of #59897 because it exists since Apache Spark 4.0.0. ### Does this PR introduce _any_ user-facing change? No. This is a documentation-only change. ### How was this patch tested? Manual review. - Both link targets already exist: the `Downloading` section of `index.md`, which lists the supported Java versions, and the `Configuring different JDKs for Spark Applications` section, which the same page already links at the top. - The class file versions above were read from `yarn/spark-<version>-yarn-shuffle.jar` of the binary distributions. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Opus 5.5 Closes #60052 from dongjoon-hyun/SPARK-60837. Authored-by: Dongjoon Hyun <dongjoon@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org> (cherry picked from commit 152e072) Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
… Java version for the Spark Shuffle Service ### What changes were proposed in this pull request? This PR adds a paragraph to the `Configuring the External Shuffle Service` section of `docs/running-on-yarn.md`. It states that: - the Spark Shuffle Service runs inside the `NodeManager` JVM, so all `NodeManager`s must run on a supported version of Java, and - unlike Spark applications, the shuffle service cannot use a different JDK from the `NodeManager`. The paragraph links the supported Java versions in `docs/index.md` instead of naming a Java version, so the same text stays correct when the minimum Java version changes. ### Why are the changes needed? `spark-<version>-yarn-shuffle.jar` is built from `common/network-yarn`, which does not override `java.version`. So its classes target the minimum Java version of Apache Spark, which is Java 17 since Apache Spark 4.0.0. For example, `YarnShuffleService.class` has the class file major version 61 in the 4.0.4, 4.1.3, 4.2.0, and 4.3.0 binary distributions. A `NodeManager` on an older Java cannot load `org.apache.spark.network.yarn.YarnShuffleService`. The guide explains how to use a different JDK for Spark applications when the YARN cluster runs an older Java (`Configuring different JDKs for Spark Applications`). That sets `JAVA_HOME` of the AM and the executors only, and does not help the shuffle service, which the `NodeManager` loads as an auxiliary service. However, the guide has never mentioned the Java requirement of the `NodeManager`s. For example, the [v4.0.0](https://github.com/apache/spark/releases/tag/v4.0.0) (2025-05-19) guide said `Apache Hadoop does not support Java 17 as of 3.4.1`, while its `Configuring the External Shuffle Service` section had no Java requirement. This was raised in the review of #59897 (#59897 (comment)), which makes Java 21 the minimum in Apache Spark 5.0.0. The documentation gap is independent of #59897 because it exists since Apache Spark 4.0.0. ### Does this PR introduce _any_ user-facing change? No. This is a documentation-only change. ### How was this patch tested? Manual review. - Both link targets already exist: the `Downloading` section of `index.md`, which lists the supported Java versions, and the `Configuring different JDKs for Spark Applications` section, which the same page already links at the top. - The class file versions above were read from `yarn/spark-<version>-yarn-shuffle.jar` of the binary distributions. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Opus 5.5 Closes #60052 from dongjoon-hyun/SPARK-60837. Authored-by: Dongjoon Hyun <dongjoon@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org> (cherry picked from commit 152e072) Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
… Java version for the Spark Shuffle Service ### What changes were proposed in this pull request? This PR adds a paragraph to the `Configuring the External Shuffle Service` section of `docs/running-on-yarn.md`. It states that: - the Spark Shuffle Service runs inside the `NodeManager` JVM, so all `NodeManager`s must run on a supported version of Java, and - unlike Spark applications, the shuffle service cannot use a different JDK from the `NodeManager`. The paragraph links the supported Java versions in `docs/index.md` instead of naming a Java version, so the same text stays correct when the minimum Java version changes. ### Why are the changes needed? `spark-<version>-yarn-shuffle.jar` is built from `common/network-yarn`, which does not override `java.version`. So its classes target the minimum Java version of Apache Spark, which is Java 17 since Apache Spark 4.0.0. For example, `YarnShuffleService.class` has the class file major version 61 in the 4.0.4, 4.1.3, 4.2.0, and 4.3.0 binary distributions. A `NodeManager` on an older Java cannot load `org.apache.spark.network.yarn.YarnShuffleService`. The guide explains how to use a different JDK for Spark applications when the YARN cluster runs an older Java (`Configuring different JDKs for Spark Applications`). That sets `JAVA_HOME` of the AM and the executors only, and does not help the shuffle service, which the `NodeManager` loads as an auxiliary service. However, the guide has never mentioned the Java requirement of the `NodeManager`s. For example, the [v4.0.0](https://github.com/apache/spark/releases/tag/v4.0.0) (2025-05-19) guide said `Apache Hadoop does not support Java 17 as of 3.4.1`, while its `Configuring the External Shuffle Service` section had no Java requirement. This was raised in the review of #59897 (#59897 (comment)), which makes Java 21 the minimum in Apache Spark 5.0.0. The documentation gap is independent of #59897 because it exists since Apache Spark 4.0.0. ### Does this PR introduce _any_ user-facing change? No. This is a documentation-only change. ### How was this patch tested? Manual review. - Both link targets already exist: the `Downloading` section of `index.md`, which lists the supported Java versions, and the `Configuring different JDKs for Spark Applications` section, which the same page already links at the top. - The class file versions above were read from `yarn/spark-<version>-yarn-shuffle.jar` of the binary distributions. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Opus 5.5 Closes #60052 from dongjoon-hyun/SPARK-60837. Authored-by: Dongjoon Hyun <dongjoon@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org> (cherry picked from commit 152e072) Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
… Java version for the Spark Shuffle Service ### What changes were proposed in this pull request? This PR adds a paragraph to the `Configuring the External Shuffle Service` section of `docs/running-on-yarn.md`. It states that: - the Spark Shuffle Service runs inside the `NodeManager` JVM, so all `NodeManager`s must run on a supported version of Java, and - unlike Spark applications, the shuffle service cannot use a different JDK from the `NodeManager`. The paragraph links the supported Java versions in `docs/index.md` instead of naming a Java version, so the same text stays correct when the minimum Java version changes. ### Why are the changes needed? `spark-<version>-yarn-shuffle.jar` is built from `common/network-yarn`, which does not override `java.version`. So its classes target the minimum Java version of Apache Spark, which is Java 17 since Apache Spark 4.0.0. For example, `YarnShuffleService.class` has the class file major version 61 in the 4.0.4, 4.1.3, 4.2.0, and 4.3.0 binary distributions. A `NodeManager` on an older Java cannot load `org.apache.spark.network.yarn.YarnShuffleService`. The guide explains how to use a different JDK for Spark applications when the YARN cluster runs an older Java (`Configuring different JDKs for Spark Applications`). That sets `JAVA_HOME` of the AM and the executors only, and does not help the shuffle service, which the `NodeManager` loads as an auxiliary service. However, the guide has never mentioned the Java requirement of the `NodeManager`s. For example, the [v4.0.0](https://github.com/apache/spark/releases/tag/v4.0.0) (2025-05-19) guide said `Apache Hadoop does not support Java 17 as of 3.4.1`, while its `Configuring the External Shuffle Service` section had no Java requirement. This was raised in the review of #59897 (#59897 (comment)), which makes Java 21 the minimum in Apache Spark 5.0.0. The documentation gap is independent of #59897 because it exists since Apache Spark 4.0.0. ### Does this PR introduce _any_ user-facing change? No. This is a documentation-only change. ### How was this patch tested? Manual review. - Both link targets already exist: the `Downloading` section of `index.md`, which lists the supported Java versions, and the `Configuring different JDKs for Spark Applications` section, which the same page already links at the top. - The class file versions above were read from `yarn/spark-<version>-yarn-shuffle.jar` of the binary distributions. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Opus 5.5 Closes #60052 from dongjoon-hyun/SPARK-60837. Authored-by: Dongjoon Hyun <dongjoon@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org> (cherry picked from commit 152e072) Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
… Java version for the Spark Shuffle Service ### What changes were proposed in this pull request? This PR adds a paragraph to the `Configuring the External Shuffle Service` section of `docs/running-on-yarn.md`. It states that: - the Spark Shuffle Service runs inside the `NodeManager` JVM, so all `NodeManager`s must run on a supported version of Java, and - unlike Spark applications, the shuffle service cannot use a different JDK from the `NodeManager`. The paragraph links the supported Java versions in `docs/index.md` instead of naming a Java version, so the same text stays correct when the minimum Java version changes. ### Why are the changes needed? `spark-<version>-yarn-shuffle.jar` is built from `common/network-yarn`, which does not override `java.version`. So its classes target the minimum Java version of Apache Spark, which is Java 17 since Apache Spark 4.0.0. For example, `YarnShuffleService.class` has the class file major version 61 in the 4.0.4, 4.1.3, 4.2.0, and 4.3.0 binary distributions. A `NodeManager` on an older Java cannot load `org.apache.spark.network.yarn.YarnShuffleService`. The guide explains how to use a different JDK for Spark applications when the YARN cluster runs an older Java (`Configuring different JDKs for Spark Applications`). That sets `JAVA_HOME` of the AM and the executors only, and does not help the shuffle service, which the `NodeManager` loads as an auxiliary service. However, the guide has never mentioned the Java requirement of the `NodeManager`s. For example, the [v4.0.0](https://github.com/apache/spark/releases/tag/v4.0.0) (2025-05-19) guide said `Apache Hadoop does not support Java 17 as of 3.4.1`, while its `Configuring the External Shuffle Service` section had no Java requirement. This was raised in the review of #59897 (#59897 (comment)), which makes Java 21 the minimum in Apache Spark 5.0.0. The documentation gap is independent of #59897 because it exists since Apache Spark 4.0.0. ### Does this PR introduce _any_ user-facing change? No. This is a documentation-only change. ### How was this patch tested? Manual review. - Both link targets already exist: the `Downloading` section of `index.md`, which lists the supported Java versions, and the `Configuring different JDKs for Spark Applications` section, which the same page already links at the top. - The class file versions above were read from `yarn/spark-<version>-yarn-shuffle.jar` of the binary distributions. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Opus 5.5 Closes #60052 from dongjoon-hyun/SPARK-60837. Authored-by: Dongjoon Hyun <dongjoon@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org> (cherry picked from commit 152e072) Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
|
Thank you, @pan3793 , @sarutak , @viirya , @LuciferYang , @peter-toth , @zhengruifeng , @HyukjinKwon . I'm going to merge this before being stale because this kind of PRs are fragile. |
|
Merge Summary:
Posted by |
… `HiveExternalCatalogVersionsSuite` ### What changes were proposed in this pull request? This PR aims to make `HiveExternalCatalogVersionsSuite` test the old Spark versions that support the running Java version, instead of skipping all of them on Java 21 and later. | Java | Release lines to test | Old Spark versions to test today | | :-: | :-: | :-: | | 17 | 3.3 and later (no change) | 3.5.9, 4.0.5, 4.1.4, 4.2.1, 4.3.0 | | 21 | 4.0 and later | 4.0.5, 4.1.4, 4.2.1, 4.3.0 | | 25 | 4.2 and later | 4.2.1, 4.3.0 | | Others, e.g., 26 | None (no change) | None | Each minimum release line is the first release line whose documentation lists the Java version. - Apache Spark 3.3 to 3.5: `Spark runs on Java 8/11/17` - Apache Spark 4.0 and 4.1: `Spark runs on Java 17/21` - Apache Spark 4.2 and 4.3: `Spark runs on Java 17/21/25` No release line supports the other Java versions, e.g., Java 26. So, this suite keeps skipping the old Spark versions on them, and the log message shows the running Java version instead of `Java 21`. In addition, this PR uses `Runtime.version().feature()` instead of `Utils.isJavaVersionAtMost17`. ### Why are the changes needed? SPARK-44095 (Apache Spark 3.5.0) made this suite skip the old Spark versions on Java 21 because no Spark release supported Java 21 at that time. Now, Apache Spark 4.0.0 and later support Java 21, and Apache Spark 4.2.0 and later support Java 25. However, the Java 21 and Java 25 CIs still skip all old Spark versions. Moreover, SPARK-60669 (#59897) is going to drop Java 17 support at Apache Spark 5.0.0. After that, no `master` CI runs this suite on Java 17, and `master` would lose this backward compatibility test completely. ### Does this PR introduce _any_ user-facing change? No. This is a test-only change. ### How was this patch tested? Pass the CIs. In addition, I ran this suite manually with Java 17, 21, 25, and 26. **Java 21** ``` $ build/sbt -Phive 'hive/testOnly *HiveExternalCatalogVersionsSuite' ... [info] HiveExternalCatalogVersionsSuite: [info] - backward compatibility (16 seconds, 636 milliseconds) [info] Run completed in 52 seconds, 578 milliseconds. [info] Total number of tests run: 1 [info] Suites: completed 1, aborted 0 [info] Tests: succeeded 1, failed 0, canceled 0, ignored 0, pending 0 [info] All tests passed. $ grep -E 'SparkContext: (Running Spark version|Java version)' sql/hive/target/unit-tests.log | sed 's/.*SparkContext: //' Running Spark version 4.0.5 Java version 21.0.13 Running Spark version 4.1.4 Java version 21.0.13+9-LTS Running Spark version 4.2.1 Java version 21.0.13+9-LTS Running Spark version 4.3.0 Java version 21.0.13+9-LTS ``` **Summary** | Java | Old Spark versions that ran `spark-submit` | `backward compatibility` | | :-: | :-: | :-: | | 17.0.21 | 3.5.9, 4.0.5, 4.1.4, 4.2.1, 4.3.0 | Passed (17 seconds) | | 21.0.13 | 4.0.5, 4.1.4, 4.2.1, 4.3.0 | Passed (16 seconds) | | 25.0.5 | 4.2.1, 4.3.0 | Passed (13 seconds) | | 26.0.2 | None | Passed (11 milliseconds) | On Java 26, this suite logs `Skip tests because old Spark versions don't support Java 26.` and runs no old Spark version. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Opus 5.5 Closes #60049 from dongjoon-hyun/SPARK-60833. Authored-by: Dongjoon Hyun <dongjoon@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
… `HiveExternalCatalogVersionsSuite` ### What changes were proposed in this pull request? This PR aims to make `HiveExternalCatalogVersionsSuite` test the old Spark versions that support the running Java version, instead of skipping all of them on Java 21 and later. | Java | Release lines to test | Old Spark versions to test today | | :-: | :-: | :-: | | 17 | 3.3 and later (no change) | 3.5.9, 4.0.5, 4.1.4, 4.2.1, 4.3.0 | | 21 | 4.0 and later | 4.0.5, 4.1.4, 4.2.1, 4.3.0 | | 25 | 4.2 and later | 4.2.1, 4.3.0 | | Others, e.g., 26 | None (no change) | None | Each minimum release line is the first release line whose documentation lists the Java version. - Apache Spark 3.3 to 3.5: `Spark runs on Java 8/11/17` - Apache Spark 4.0 and 4.1: `Spark runs on Java 17/21` - Apache Spark 4.2 and 4.3: `Spark runs on Java 17/21/25` No release line supports the other Java versions, e.g., Java 26. So, this suite keeps skipping the old Spark versions on them, and the log message shows the running Java version instead of `Java 21`. In addition, this PR uses `Runtime.version().feature()` instead of `Utils.isJavaVersionAtMost17`. ### Why are the changes needed? SPARK-44095 (Apache Spark 3.5.0) made this suite skip the old Spark versions on Java 21 because no Spark release supported Java 21 at that time. Now, Apache Spark 4.0.0 and later support Java 21, and Apache Spark 4.2.0 and later support Java 25. However, the Java 21 and Java 25 CIs still skip all old Spark versions. Moreover, SPARK-60669 (#59897) is going to drop Java 17 support at Apache Spark 5.0.0. After that, no `master` CI runs this suite on Java 17, and `master` would lose this backward compatibility test completely. ### Does this PR introduce _any_ user-facing change? No. This is a test-only change. ### How was this patch tested? Pass the CIs. In addition, I ran this suite manually with Java 17, 21, 25, and 26. **Java 21** ``` $ build/sbt -Phive 'hive/testOnly *HiveExternalCatalogVersionsSuite' ... [info] HiveExternalCatalogVersionsSuite: [info] - backward compatibility (16 seconds, 636 milliseconds) [info] Run completed in 52 seconds, 578 milliseconds. [info] Total number of tests run: 1 [info] Suites: completed 1, aborted 0 [info] Tests: succeeded 1, failed 0, canceled 0, ignored 0, pending 0 [info] All tests passed. $ grep -E 'SparkContext: (Running Spark version|Java version)' sql/hive/target/unit-tests.log | sed 's/.*SparkContext: //' Running Spark version 4.0.5 Java version 21.0.13 Running Spark version 4.1.4 Java version 21.0.13+9-LTS Running Spark version 4.2.1 Java version 21.0.13+9-LTS Running Spark version 4.3.0 Java version 21.0.13+9-LTS ``` **Summary** | Java | Old Spark versions that ran `spark-submit` | `backward compatibility` | | :-: | :-: | :-: | | 17.0.21 | 3.5.9, 4.0.5, 4.1.4, 4.2.1, 4.3.0 | Passed (17 seconds) | | 21.0.13 | 4.0.5, 4.1.4, 4.2.1, 4.3.0 | Passed (16 seconds) | | 25.0.5 | 4.2.1, 4.3.0 | Passed (13 seconds) | | 26.0.2 | None | Passed (11 milliseconds) | On Java 26, this suite logs `Skip tests because old Spark versions don't support Java 26.` and runs no old Spark version. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Opus 5.5 Closes #60049 from dongjoon-hyun/SPARK-60833. Authored-by: Dongjoon Hyun <dongjoon@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org> (cherry picked from commit 59bdfec) Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
### What changes were proposed in this pull request? This PR aims to upgrade `Apache Derby` from `10.16.1.1` to `10.17.1.0` for Apache Spark 5.0.0. - https://db.apache.org/derby/releases/release-10_17_1_0.cgi (2023-11-10) ### Why are the changes needed? Since Apache Spark 5.0.0 requires Java 21 or later (SPARK-60669), we can use `Derby 10.17.x`, which supports only Java 21 and later. Previously, we stayed on `Derby 10.16.1.1` because `10.17.1.0` requires Java 21+. - #59897 `Derby 10.17.1.0` brings the following fixes. - [DERBY-7143](https://issues.apache.org/jira/browse/DERBY-7143) HarmonySerialBlob.getBinaryStream(long, long) makes it impossible to retrieve the last character of the Blob - [DERBY-7144](https://issues.apache.org/jira/browse/DERBY-7144) MERGE INSERT failing when target has GENERATED IDENTITY column - [DERBY-7147](https://issues.apache.org/jira/browse/DERBY-7147) LDAP injection vulnerability in LDAPAuthenticationImpl (CVE-2022-46337) - [DERBY-7149](https://issues.apache.org/jira/browse/DERBY-7149) Make it possible to build and test Derby cleanly with JDK 20 In addition, `10.17.1.0` is the final release of Apache Derby because the Derby developers voted to retire the project on 2025-10-10. ### Does this PR introduce _any_ user-facing change? No behavior change is expected. Only the bundled Derby jars (`derby`, `derbyshared`, `derbytools`) are upgraded. ### How was this patch tested? Pass the CIs. In addition, I manually ran the test suites that use Derby on Java 21. ``` $ build/sbt -Phive -Phive-thriftserver \ "core/testOnly *JdbcRDDSuite" \ "sql/testOnly *DerbyTableCatalogSuite *JDBCSuite" \ "hive/testOnly *HiveSharedStateSuite *HiveExternalCatalogSuite" \ "hive-thriftserver/testOnly *SparkSQLEnvSuite *CliSuite" ``` ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Opus 5.5 Closes #60065 from dongjoon-hyun/dongjoon/derby-upgrade-9b7bf2. Authored-by: Dongjoon Hyun <dongjoon@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
…olden files ### What changes were proposed in this pull request? This PR aims to use the Java 21 results as the default SQL golden files because Apache Spark 5.0.0 requires Java 21 or later since SPARK-60669 (#59897). - Promote the following 7 `*.sql.out.java21` files to the default `*.sql.out` files and remove the `.java21` files. - `datetime-formatting.sql.out` - `nonansi/try_aggregates.sql.out` - `nonansi/try_arithmetic.sql.out` - `postgreSQL/float4.sql.out` - `postgreSQL/int8.sql.out` - `postgreSQL/numeric.sql.out` - `try_aggregates.sql.out` - Remove the Java version-based golden file selection of `SQLQueryTestSuite` and `ThriftServerQueryTestSuite`, which SPARK-40732 (#41658) added, and the `.*out.java21` pattern of `dev/.rat-excludes`. - Update the meaning of the datetime pattern letter `F` in `sql-ref-datetime-pattern.md` to `aligned-week-of-month`, as the Java 21 `DateTimeFormatter` documentation describes it. - Add a migration guide item for the users who ran Spark 4.x on Java 17. ### Why are the changes needed? The `.java21` files and the selection logic were needed only while Spark supported both Java 17 and Java 21. The differences come from the following Java changes. - [JDK-8282081](https://bugs.openjdk.org/browse/JDK-8282081): `DateTimeFormatter` maps the pattern letter `F` to `ALIGNED_WEEK_OF_MONTH` instead of `ALIGNED_DAY_OF_WEEK_IN_MONTH`. - [JDK-4511638](https://bugs.openjdk.org/browse/JDK-4511638): `Float.toString` and `Double.toString` return the shortest decimal that represents the value. Since Java 17 cannot build the `master` branch anymore, nobody can regenerate the default files of these inputs. On Java 21, `SPARK_GENERATE_GOLDEN_FILES=1` updates only the `.java21` files, so the default files become stale whenever these inputs change. In addition, the documentation of `F` describes the Java 17 behavior. ### Does this PR introduce _any_ user-facing change? No. Apache Spark 5.0.0 already requires Java 21, and this PR changes only test files and documentation. The new migration guide item documents the following differences, which are the results of the Apache Spark 4.3.0 binary distribution on Java 17 and Java 21. | Query | Java 17 | Java 21 | | - | - | - | | `SELECT date_format(date '2019-12-31', 'F')` | `3` | `5` | | `SELECT CAST(CAST(4567890123456789 AS FLOAT) AS STRING)` | `4.5678899E15` | `4.56789E15` | | `SELECT CAST(1.0751133388005187E17D AS DECIMAL(38, 0))` | `107511333880051872` | `107511333880051870` | ### How was this patch tested? Pass the CIs. I also regenerated the golden files of the 7 inputs with Java 21 after removing the selection logic, and confirmed that they are identical to the removed `.java21` files and that no other golden file changed. ``` $ SPARK_GENERATE_GOLDEN_FILES=1 build/sbt "sql/testOnly org.apache.spark.sql.SQLQueryTestSuite -- -z datetime-formatting.sql -z try_aggregates.sql -z nonansi/try_arithmetic.sql -z postgreSQL/float4.sql -z postgreSQL/int8.sql -z postgreSQL/numeric.sql" ``` Then, the following passed with Java 21. `ThriftServerQueryTestSuite` ignores `postgreSQL/float4.sql` as before. ``` $ build/sbt "sql/testOnly org.apache.spark.sql.SQLQueryTestSuite -- -z datetime-formatting.sql -z try_aggregates.sql -z nonansi/try_arithmetic.sql -z postgreSQL/float4.sql -z postgreSQL/int8.sql -z postgreSQL/numeric.sql" ... [info] Tests: succeeded 14, failed 0, canceled 0, ignored 0, pending 0 $ build/sbt -Phive -Phive-thriftserver "hive-thriftserver/testOnly org.apache.spark.sql.hive.thriftserver.ThriftServerQueryTestSuite -- -z datetime-formatting.sql -z try_aggregates.sql -z nonansi/try_arithmetic.sql -z postgreSQL/float4.sql -z postgreSQL/int8.sql -z postgreSQL/numeric.sql" ... [info] Tests: succeeded 6, failed 0, canceled 0, ignored 1, pending 0 ``` The same `SQLQueryTestSuite` command also passed with Java 25. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Opus 5.5 Closes #60109 from dongjoon-hyun/SPARK-60894. Authored-by: Dongjoon Hyun <dongjoon@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
What changes were proposed in this pull request?
This PR aims to drop Java 17 support in Apache Spark 5.0.0 by making Java 21 the minimum Java version.
pom.xml: Changejava.version,java.minimum.version, and the-releaseoption ofscala-maven-pluginto 21.master.publish_snapshot.ymlkeeps Java 17 forbranch-4.*.build_java17.ymlandbuild_maven_java21.ymlinto no-op placeholders onmasterlikebuild_scala213.yml, and remove themasterbadge ofbuild_maven_java21.ymlfromREADME.md.masterno longer supports Java 17, andbuild_maven.ymlnow runs the same Maven build with Java 21. The files are kept because the branch schedulers dispatch them forbranch-4.*.masterrelease image, and makerelease-build.shreject Java versions older than 21 for Apache Spark 5.0.0 and later.SystemRequirements, whichcheckJavaVersion()reads.bin/pyspark: Install JDK 21 instead of JDK 17 when no Java is found.dev-run-integration-tests.sh.README.md,docs/index.md,docs/building-spark.md,docs/running-on-yarn.md,docs/security.md,docs/tuning.md, andpython/docs/source/getting_started/install.rst.Why are the changes needed?
The minimum supported Java version for Apache Spark 5.0.0 is Java 21.
Does this PR introduce any user-facing change?
Yes. Apache Spark 5.0.0 requires Java 21 or later. Since all Spark artifacts are compiled for Java 21 (class file version 65), this applies to the client side as well as the cluster runtime. For example, Java 21 is required for:
spark-connect-client-jvm) or the Spark Connect JDBC driver (spark-connect-client-jdbc).spark-launcher.The pure-Python Spark Connect client (
pyspark-client) is not affected.How was this patch tested?
Pass the CIs. In addition, I manually verified the following.
Test/compile,unidoc, and MiMa pass with Java 21.openjdk-21-jdk-headlessinstalls on the base image of the release image (ubuntu:jammy-20250819), andrelease-build.shaccepts it for5.0.0-SNAPSHOTwhile rejecting Java 17 for Apache Spark 5.0.0.workflow_dispatch.SystemRequirementsof SparkR, parsed the same way ascheckJavaVersion(), rejects Java 17 and accepts Java 21 and 25.Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Opus 5.5